<?php
echo '<table><tr>';
	echo '<td colspan = "2">';
		echo '<font color ="green"><h3>'.$cat_name.'</h3></font>';
	echo '</td></tr>';
	echo '<tr><td>';
		echo '<img src="'.base_url().'public/images/'.$images.'" width="450" height="300">';;
	echo '</td><td><table>';
		echo '<tr><td>';
			echo 'DESCRIPTION:'.$cat_description.'<br>'; 
		echo '</td></tr>';
		echo '<tr><td>';
			echo 'DEMENSION:'.$cat_demension.'<br>'; 
		echo '</td></tr>';
		echo '<tr><td>';
			echo 'ASSEMBLY:'.$cat_assembly.'<br>';
		echo '</td></tr>';
		echo '<tr><td>';
			echo 'MATERIAL:'.$cat_material.'<br>';
		echo '</td></tr>';
		echo '<tr><td>';
			echo 'COLOR:'.$cat_color.'<br>';
		echo '</td></tr>';
		echo '<tr><td>';
			echo 'PRICE:'.$cat_price.'<br>';
		echo '</td></tr>';
	echo '</table></td>';
echo '</tr></table>';
echo '<hr color="blue" width="80%">';
echo '<font color ="green"><h3>RELATED PRODUCTS</h3></font>';
$col = 3;
	$countsubcate = count($relation);
	if ($countsubcate>0){//if $countsubcate
		echo '<table class="contentcate">';
			for ($i=0;$i<$countsubcate;$i=$i+$col){//for $countsubcate
				echo '<tr>';
					echo '<td class="contentcate_td">';
						if(isset($relation[$i]['cat_name'])){
							echo anchor(base_url().'catcont/getCatSubId/'.$relation[$i]['cat_id'],$relation[$i]['cat_name']);
							echo anchor(base_url().'catcont/getCatSubId/'.$relation[$i]['cat_id'],'<img src="'.base_url().'public/images/livingroom/'.$relation[$i]['images'].'" class="statusicon" width="260" height="170">');
						}
					echo '</td>';
					echo '<td class="contentcate_td">';
						if(isset($relation[$i+1]['cat_name'])){
							echo anchor(base_url().'catcont/getCatSubId/'.$relation[$i+1]['cat_id'],$relation[$i+1]['cat_name']);
							echo anchor(base_url().'catcont/getCatSubId/'.$relation[$i+1]['cat_id'],'<img src="'.base_url().'public/images/livingroom/'.$relation[$i+1]['images'].'" class="statusicon" width="260" height="170">');
						}
					echo '</td>';
					echo '<td class="contentcate_td">';
						if(isset($relation[$i+2]['cat_name'])){
							echo anchor(base_url().'catcont/getCatSubId/'.$relation[$i+2]['cat_id'],$relation[$i+2]['cat_name']);
							echo anchor(base_url().'catcont/getCatSubId/'.$relation[$i+2]['cat_id'],'<img src="'.base_url().'public/images/livingroom/'.$relation[$i+2]['images'].'" class="statusicon" width="260" height="170">');
						}
					echo '</td>';
				echo '</tr>';
			}//end //for $countsubcate
		echo '</table>';
	} //end $countsubcate